﻿@model IEnumerable<User>


<div class="container p-3">
    <div class="row pt-4">
        <div class="col-6">
            <h1 class="text-primary">用户信息</h1>
        </div>
        <div class="col-6">
            <a asp-controller="User" asp-action="Create" class="btn btn-primary">添加</a>
        </div>
    </div>

</div>
<div>
    <table class="table table-bordered table-striped">
        <thead>
            <tr>
                <th>
                    名字
                </th>
                <th>
                    手机号
                </th>
                <th>
                    角色id
                </th>
                <th></th>
            </tr>
        </thead>
        <tbody>
            @foreach (var obj in Model)
            {
                <tr>
                    <td>
                        @obj.Name
                    </td>
                    <td>
                        @obj.Phone
                    </td>
                    <td>
                        @obj.Roleid
                    </td>
                    <td>
                        <div class="btn -group" role="group" style="float:left" >
                            <a asp-controller="User" asp-action="Edit" asp-route-id="@obj.Id" class="btn btn-primary" >修改</a>
                        </div>
                        <div class=" btn -group" role="group" style="float:left">
                            <a asp-controller="User" asp-action="Delete" asp-route-id="@obj.Id" class="btn btn-danger">删除</a>
                        </div>
                    </td>
                </tr>
            }
        </tbody>
    </table>
</div>